home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / Prograph Classic 2.6.1 / Prograph Reference Manual / Prograph Reference 5-7 / Prograph Reference 5-7.rsrc / TEXT_180.txt < prev    next >
Encoding:
Text File  |  1995-10-25  |  11.3 KB  |  427 lines

  1.  
  2. Dialogs and Alerts 
  3.  
  4.  
  5. __________________________________________
  6. GetNewDialog  *414*
  7.  
  8. Input names:   dialogID, dStorage, behind
  9.  
  10. Input types:   integer, Ptr, WindowPtr 
  11.  
  12. Output names:   DialogPtr
  13.  
  14. Output types:   DialogPtr
  15.  
  16. Description:   Creates a dialog as specified by its parameters and returns a pointer to the new dialog.  DialogID is the resource ID of a dialog template. DStorage is a pointer to the storage to use for the dialog record.  The behind parameter specifies the window behind which the dialog window is to be placed on the desktop.
  17.  
  18.  
  19. __________________________________________
  20. CloseDialog  *414*
  21.  
  22. Input names:   theDialog
  23.  
  24. Input types:   DialogPtr
  25.  
  26. Description:   Removes the dialog from the screen and deletes it from the window list.  Memory associated with the dialog window data structures and with dialog items is released, but the dialog record and item list are not disposed of.
  27.  
  28.  
  29. __________________________________________
  30. DisposDialog  *414*
  31.  
  32. Input names:   theDialog
  33.  
  34. Input types:   DialogPtr
  35.  
  36. Description:   Calls CloseDialog and then releases the memory occupied by the dialog‚Äôs item list and dialog record. 
  37.  
  38.  
  39. __________________________________________
  40. ModalDialog  *415*
  41.  
  42. Input names:   filterProc, itemHit
  43.  
  44. Input types:   ProcPtr, integer
  45.  
  46. Output names:   itemHit
  47.  
  48. Output types:   integer
  49.  
  50. Description:   Repeatedly gets and handles events in the dialog‚Äôs window; after handling an event involving an enabled dialog item, it returns with the item number in itemHit.  The filterProc parameter determines how events are filtered.  
  51.  
  52.  
  53. __________________________________________
  54. Invoking Alerts  *415*
  55.  
  56. In the following routines, the filterProc parameter determines how events are filtered. A filterProc of 0 leaves event processing up to the system.  The template for the alert, along with its buttons, static text items, and icons, is normally created using ResEdit.
  57.  
  58.  
  59. __________________________________________
  60. Alert  *415*
  61.  
  62. Input names:   alertID, filterProc
  63.  
  64. Input types:   integer, ProcPtr
  65.  
  66. Output names:   Integer
  67.  
  68. Output types:   integer
  69.  
  70. Description:   Invokes the alert defined by the alert template that has the given resource ID.  If no alert box is drawn at this stage, Alert returns a function result of -1; otherwise, it creates and displays the alert window for this alert and draws the alert box.
  71.  
  72.  
  73. __________________________________________
  74. StopAlert  *415*
  75.  
  76. Input names:   alertID, filterProc
  77.  
  78. Input types:   integer, ProcPtr
  79.  
  80. Output names:   Integer
  81.  
  82. Output types:   integer
  83.  
  84. Description:   Same as Alert (see above) except that before drawing the items of the alert in the alert box, it draws the Stop icon in the top left corner of the box.
  85.  
  86.  
  87. __________________________________________
  88. NoteAlert  *416*
  89.  
  90. Input names:   alertID, filterProc
  91.  
  92. Input types:   integer, ProcPtr
  93.  
  94. Output names:   Integer
  95.  
  96. Output types:   integer
  97.  
  98. Description:   Same as StopAlert (see above) except that it draws the Note icon.
  99.  
  100.  
  101. __________________________________________
  102. CautionAlert  *416*
  103.  
  104. Input names:   alertID, filterProc
  105.  
  106. Input types:   integer, ProcPtr
  107.  
  108. Output names:   Integer
  109.  
  110. Output types:   integer
  111.  
  112. Description:   Same as StopAlert (see above) except that it draws the Caution icon.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128. __________________________________________
  129. Manipulating Items in Dialogs and Alerts
  130.  
  131.  
  132. __________________________________________
  133. ParamText  *416*
  134.  
  135. Input names:   param0, param1, param2, param3
  136.  
  137. Input types:   string, string, string, string
  138.  
  139. Description:   Provides a means of substituting text:   param0 through param3 will replace the special strings '^0' through '^3' in all statText items in all subsequent dialog or alert boxes.
  140.  
  141.  
  142. __________________________________________
  143. GetDItem  *417*
  144.  
  145. Input names:   theDialog, itemNo, itemType, item, box
  146.  
  147. Input types:   DialogPtr, integer, integer, Handle, Rect
  148.  
  149. Output names:   itemType, item, box
  150.  
  151. Output types:   integer, Handle, Rect
  152.  
  153. Description:   Returns in its var parameters the following information about the item numbered itemNo in the given dialog‚Äôs item list:   in the itemType parameter, the item type; in the item parameter, a handle to the item (or, for item type userItem, the procedure pointer); and in the box parameter, the display rectangle for the item.
  154.  
  155.  
  156. __________________________________________
  157. SetDItem  *417*
  158.  
  159. Input names:   theDialog, itemNo, itemType, item, box
  160.  
  161. Input types:   DialogPtr, integer, integer, Handle, Rect
  162.  
  163. Description:   Sets the item numbered itemNo in the given dialog‚Äôs item list, as specified by the parameters.  The parameters have the same meaning as in GetDItem (see above).
  164.  
  165.  
  166. __________________________________________
  167. GetIText  *417*
  168.  
  169. Input names:   item, text
  170.  
  171. Input types:   Handle, string
  172.  
  173. Output names:   text
  174.  
  175. Output types:   string
  176.  
  177. Description:   Given a handle in a dialog box, as returned by GetDItem (see above), GetIText returns the text of the item in the text parameter. 
  178.  
  179.  
  180. __________________________________________
  181. SetIText  *417*
  182.  
  183. Input names:   item, text
  184.  
  185. Input types:   Handle, string
  186.  
  187. Description:   Given a handle in a dialog box, as returned by GetDItem (see above), SetIText sets the text of the item to the specified text and draws the item.
  188.  
  189.  
  190. __________________________________________
  191. SelIText  *418*
  192.  
  193. Input names:   theDialog, itemNo, startSel, endSel
  194.  
  195. Input types:   DialogPtr, integer, integer, integer
  196.  
  197. Description:   Given a pointer to a dialog and the item number of an editText item in the dialog box, SelIText does the following:  
  198.  
  199. o    If the item contains text, SelIText sets the selection range to extend from character position startSel up to but not including character position endSel.  The selection range is inverted unless startSel equals endSel, in which case a blinking vertical bar is displayed to indicate an insertion point at that position.
  200.  
  201. o    If the item doesn‚Äôt contain text, SelIText simply displays the insertion point.
  202.  
  203.  
  204. __________________________________________
  205. Graphic Utilities 
  206.  
  207.  
  208. __________________________________________
  209. ScreenRes  *418*
  210.  
  211. Input names:   screenHRes, screenVRes
  212.  
  213. Input types:   integer, integer 
  214.  
  215. Output names:   screenHRes, screenVRes
  216.  
  217. Output types:   integer, integer 
  218.  
  219. Description:   Returns the resolution of the screen of the Macintosh being used.  ScreenHRes and screenVRes are the number of pixels per inch horizontally and vertically, respectively.
  220.  
  221.  
  222. __________________________________________
  223. GetIcon  *418*
  224.  
  225. Input names:   iconID 
  226.  
  227. Input types:   integer 
  228.  
  229. Output names:   Handle
  230.  
  231. Output types:   Handle 
  232.  
  233. Description:   Returns a handle to the icon having the given resource ID, reading it from the resource file, if necessary.  If the resource can‚Äôt be read, GetIcon returns NULL.
  234.  
  235.  
  236. __________________________________________
  237. PlotIcon  *419*
  238.  
  239. Input names:   theRect, theIcon
  240.  
  241. Input types:   Rect, Handle 
  242.  
  243. Description:   Draws the icon, whose handle is theIcon, in the rectangle theRect, which is the local coordinates of the current grafPort.
  244.  
  245.  
  246. __________________________________________
  247. GetPattern  *419*
  248.  
  249. Input names:   patID 
  250.  
  251. Input types:   integer 
  252.  
  253. Output names:   PatHandle
  254.  
  255. Output types:   PatHandle 
  256.  
  257. Description:   Returns a handle to the pattern having the given resource ID, reading it from the resource file, if necessary.  If the resource can‚Äôt be read, GetPattern returns NIL.
  258.  
  259.  
  260. __________________________________________
  261. GetIndPattern  *419*
  262.  
  263. Input names:   thePattern, patListID, index 
  264.  
  265. Input types:   Pattern, integer, integer 
  266.  
  267. Output names:   thePattern
  268.  
  269. Output types:   Pattern 
  270.  
  271. Description:   Returns in Integer a pattern in the pattern list that has the resource ID patListID, reading it from the resource file, if necessary.  The pattern is specified by the index parameter, which can range from 1 to the number of patterns in the pattern list.
  272.  
  273.  
  274. __________________________________________
  275. Miscellaneous Utilities 
  276.  
  277.  
  278. __________________________________________
  279. InvalRect  *419*
  280.  
  281. Input name:      theRect
  282.  
  283. Input type:      Rect
  284.  
  285. Description:   Adds the given rectangle into the update region of the current grafPort‚Äôs window.
  286.  
  287.  
  288. __________________________________________
  289. InvalRgn  *420*
  290.  
  291. Input name:      theRgn
  292.  
  293. Input type:      Handle
  294.  
  295. Description:   Adds the given region into the update region of the current grafPort‚Äôs window.
  296.  
  297.  
  298. __________________________________________
  299. SlopeFromAngle  *420*
  300.  
  301. Input names:   angle 
  302.  
  303. Input types:   integer 
  304.  
  305. Output names:   Fixed
  306.  
  307. Output types:   LongInt
  308.  
  309. Description:   Given an angle, SlopeFromAngle returns the slope dh/dv of the line forming that angle with the y-axis (dh/dv is the horizontal change divided by the vertical change between any two points on the line).
  310.  
  311.  
  312. __________________________________________
  313. AngleFromSlope  *420*
  314.  
  315. Input names:   slope 
  316.  
  317. Input types:   LongInt 
  318.  
  319. Output names:   angle
  320.  
  321. Output types:   integer
  322.  
  323. Description:   Given the slope dh/dv of a line (see SlopeFromAngle above), AngleFromSlope returns the angle formed by that line and the y-axis.  The angle returned is between 1 and 180 (inclusive), in degrees measured clockwise from 12 o‚Äôclock.
  324.  
  325.  
  326. __________________________________________
  327. GetMouse  *420*
  328.  
  329. Input names:   mouseLoc
  330.  
  331. Input types:   Point 
  332.  
  333. Output names:   mouseLoc
  334.  
  335. Output types:   Point
  336.  
  337. Description:   Returns the current mouse location in the mouseLoc parameter.  The location is given in the local coordinate system of the current grafPort (which might be, for example, the currently front window).
  338.  
  339.  
  340. __________________________________________
  341. Button  *421*
  342.  
  343. Output names:   Boolean
  344.  
  345. Output types:   boolean
  346.  
  347. Description:   Returns TRUE if the mouse button is currently down, and FALSE if it isn‚Äôt. 
  348.  
  349.  
  350. __________________________________________
  351. TickCount  *421*
  352.  
  353. Output names:   LongInt
  354.  
  355. Output types:   LongInt
  356.  
  357. Description:   Returns the current number of ticks (sixtieths of a second) since the system last started up.
  358.  
  359.  
  360. __________________________________________
  361. SysBeep  *421*
  362.  
  363. Input names:   duration
  364.  
  365. Input types:   integer
  366.  
  367. Description:   Causes the system to beep. If the speaker volume has been set to 0 (silent), SysBeep instead causes the menu bar to blink once. 
  368.  
  369.  
  370. __________________________________________
  371. SysEnvirons  *421*
  372.  
  373. Input names:   versRequested, theWorld
  374.  
  375. Input types:   integer, SysEnvRec
  376.  
  377. Output names:   error, theWorld
  378.  
  379. Output types:   integer, SysEnvRec
  380.  
  381. Description:   SysEnvirons is the standard way to determine the features on a given machine. It requires a version number for the type of SysEnvRec requested:    use a value of 1 for versRequested for all Systems before 6.0.1 and a value of 2 thereafter. The data structure theWorld is returned. Various fields of theWorld can be examined to discover the type of machine that the program is running on, if that machine has a floating point co-processor, color QuickDraw, what type of keyboard it has and so on.
  382.  
  383. NOTE:    Starting with later versions of System 6, using the Gestalt Manager is the recommended way of obtaining information about a system configuration.
  384.  
  385.  
  386. __________________________________________
  387. Field Constant Value   *422*
  388.  
  389. machineType   
  390.  
  391.  envMac    -1    
  392.  envXL    -2    
  393.  envMachUnknown    0    
  394.  env512KE    1    
  395.  envMacPlus    2    
  396.  envSE    3    
  397.  envMacII    4    
  398.  envMacIIx    5    
  399.  envMacIIcx    6    
  400.  envSE30    7    
  401.  envPortable    8    
  402.  envIIci    9    
  403.    
  404. processor   
  405.  
  406.  envCPUUnknown    0    
  407.  env68000    1    
  408.  env68010    2    
  409.  env68020    3    
  410.  env68030    4    
  411.    
  412. keyboardType   
  413.  
  414.  envUnknownKbd    0    
  415.  envMacKbd    1    
  416.  envMacAndPad    2    
  417.  envMacPlusKbd    3    
  418.  envAExtendKbd    4    
  419.  envStandADBKbd    5    
  420.  envPortADBKbd    6    
  421.  envPortISOADBKbd    7    
  422.  envStdISOADBKbd    8    
  423.  envExtISOADBKbd    9    
  424.  
  425.  
  426.  
  427.